home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Belgian Amiga Club - ADF Collection
/
BS1 part 65.zip
/
BS1 part 65
/
Math Visin v2.1 disk 1.adf
/
Arexx.WB
/
tutorialexample
< prev
next >
Wrap
Text File
|
1992-02-12
|
3KB
|
128 lines
/* TutorialExample show what an ARexx program looks like
This is a simple ARexx program to teach you some of the things you
need to know to use ARexx programs with MathVision. Not a whole lot more to
say. Just run this program and find out!
==========================================================================*/
ADDRESS "MathVision"
OPTIONS RESULTS
NUMERIC DIGITS 14
/* sign-on message */
ClrScr = D2C(12)
SAY ClrScr "---------------- Tutorial Example ---------------- "
SAY ""
SAY " Welcome to a short tutorial on using ARexx programs with MathVision."
SAY ""
SAY " We are going to look at two topics:"
SAY ""
SAY " 1. How to flip screens"
SAY " 2. How to break out of an ARexx program"
SAY ""
Options Prompt " Press <Return> to Continue "
PULL doit
SAY ClrScr"---------- Flipping Screens ----------"
SAY ""
SAY " MathVision uses multiples screens. They are:"
SAY ""
SAY " - Editing Screen (Numerical Swamp)"
SAY " - Plot Screen (pictures plotted here)"
SAY " - Workbench Screen (This screen, used for ARexx)"
SAY ""
SAY " Using multiple screens keeps things from getting"
SAY " jumbled together. However, you then have to flip between"
SAY " them to get to what you want. Normally, ARexx programs will"
SAY " handle this for you."
SAY ""
options prompt "Press <Return> to see the Edit and Plot screens "
pull doit
EditScreenToFront
call Delay( 700 )
PlotScreenToFront
Say ClrScr
call Delay( 700 )
WorkbenchScreenToFront
SAY " But ARexx does not always flip the screens for you, or it"
SAY " leaves the wrong one in front. You can flip them easily yourself."
SAY ""
SAY " To flip the workbench screen to the front or back, hold down"
SAY " the <C=> key to the left of the space bar, and press <N> or <M>."
SAY ""
options prompt " You try it! Then press <Return> to continue "
pull Doit
SAY ClrScr"----------------- Breaking Out ----------------- "
SAY ""
SAY " Sometimes you want to stop a program rather than waiting for"
SAY " it to finish. This is done by clicking in one of the MathVision"
SAY " screens, holding down the <Ctrl> key, and pressing <ESC>. This tells"
SAY " cooperating programs that they should stop. Try this out after"
SAY " pressing return."
SAY ""
SAY " Click, <Ctrl><Esc>"
SAY ""
options prompt "Press <Return>, then try it! "
pull doit
/*---------------------------- demo simple plot ------------------------- */
StopSign F
Xmin 0
Xmax 10
Ymin "-1"
Ymax 1
EraseScreen
OverPlot T
SimpleGradient1 F
SimpleGradient2 F
SimplePen 1
SimpleSampleDelta 1
SimpleNoisy T
PlotScreenToFront
DO t = 1 to 10
f0 "sin(x)/"t
PlotSimple
Get StopSign /* did user press <ctrl><esc>? */
StopValue = RESULT
if (StopValue = "T") then break
END
WorkbenchScreenToFront
SAY ClrScr
IF (StopValue = "T")
THEN SAY " Congratulations! You stopped it!"
ELSE SAY " Better luck next time!"
SAY ""
SAY " In review, you learned:"
SAY ""
SAY " -Workbench Screen to front: <C=><N>"
SAY " -Workbench Screen to back: <C=><M>"
SAY " -Stop a MathVision/ARexx program:"
SAY " Click on screen, then <Ctrl><ESC>"
SAY ""
options prompt " Click here, then press <RETURN> to exit "
pull doit
EXIT
/*---------------------------- DELAY ------------------------- */
/* I indulge the graciousness of other programs to let me waste */
/* time in a busy wait */
DELAY:
arg times
do i = 1 to times; end;
return 0